package com.jzsec.proxy.jzsecproxy.utils;


public class SystemUtils {

	public static int getWC(long w, long c) {
		if (0 == c) c = 1;
		return new Double(w / c).intValue();
	}

	/**
	 * @param w 线程等待时间
	 * @param c 线程计算时间
	 * @return 系统最优线程数
	 */
	public static int getThreadNum(long w, long c) {
		if (0 == c) c = 1;
		return new Double(Runtime.getRuntime().availableProcessors() * 0.8 * (1 + w / c)).intValue();
	}
}
